package lhy.autoparts.pojo;

import lhy.frontend.annotation.EntityComment;
import lhy.orm.Serializer;
import lhy.orm.annotation.Column;
import lhy.lhyorm.field.DatabaseField;
import lhy.lhyorm.table.DatabaseTable;

@DatabaseTable(tableName = "User")
@EntityComment("系统用户")
public class User implements java.io.Serializable {
	@Column("用户编号")
	@DatabaseField(id=true)
	 public String  id;
	@Column("用户昵称")
	@DatabaseField public String  name;
	@Column("密码")
	@DatabaseField public String  pwd;
	@Column("角色")
	@DatabaseField(foreign=true  )
	public UserRole role;
	@Column("备注")
	@DatabaseField(canBeNull=true) public String  comment;
//todo TABLE_MAPPING注解  改数据库

	public User() {
	}

	public User(String id, String name, String pwd, UserRole role, String comment) {
		this.id = id;
		this.name = name;
		this.pwd = pwd;
		this.role = role;
		this.comment = comment;
	}

	@Override
	public String toString() {
		return Serializer.doSerialize(this);
	}
}